//
// Created by enemy1205 on 2021/8/16.
//
#pragma once

#include <opencv2/core/types.hpp>
#include <opencv2/core/mat.hpp>
#include <iostream>
using cv::Point2f,cv::Mat;
const float PI = 3.141592654f;
const float e = 2.7182818f;
const float g = 9.788f;
// pnp 姿态解算
struct ResultPnP
{
    double yaw;
    double pitch;
    double roll;
    Mat tran_vec;
    Mat rotat_vec;
    float distance;
};
extern float getDistance(const Point2f &, const Point2f &);
// 获取与水平方向的夹角
inline float getHorizontalAngle(const Point2f &start, const Point2f &end)
{
    return -atanf((end.y - start.y) / (end.x - start.x));
}
float Deg2Rad(float Deg);

float Rad2Deg(float Rad);
// 计算相机中心相对于装甲板中心的角度
Point2f calculateRelativeAngle(const Mat &, const Mat &, Point2f);
// 计算装甲板中心的像素坐标
Point2f calculateRelativeCenter(const Mat &, const Mat &, Point2f);
// 获取角度差
float getDeltaAngle(float, float);